{% set clazz = "coupons" %}
{% set title = "兑换千丁券" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section>
    {% if list.length %}
      <div class="showcases">
        <div id="coupons" class="content">
          {% for item in list %}
            <a class="item round" href="/integral/details/{{ item.id }}">
              <div class="vspace hspace" ui-mode="20px">
                <div class="autofix figure">
                  <img src="{{ item.coverImg|thumb(305, 305) }}" />
                </div>
                {% if item.isFinished %}
                  <img class="sellout" src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-e23b028d-83f4-42d2-867b-f7a1a1f7fe8f.png" />
                {% endif %}
              </div>
              <div class="text">
                <h4 class="name text-ellipsis">{{ item.goodsName }}</h4>
                <small class="brief">
                积分：<i class="split text-orange">{{ item.consumeIntegral }}</i>
                {% if item.marketPrice %}
                  <i class="text-gray">{{ item.marketPrice|currency(0) }}</i></small>
                {% endif %}
              </div>
            </a>
          {% endfor %}
        </div>
      </div>
    {% else %}
      <div class="plate">
        <div class="draw">
          <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
          <h4 class="title">暂时没有可以兑换的千丁券</h4>
        </div>
      </div>
    {% endif %}
  </section>
  {% raw %}
  <script id="couponsTempl" type="text/swig-template">
    {% for item in list %}
      <a class="item round" href="/integral/details/{{ item.id }}">
        <div class="vspace hspace" ui-mode="20px">
          <div class="autofix figure">
            <img src="{{ item.coverImg|thumb(305, 305) }}" />
          </div>
          {% if item.isFinished %}
            <img class="sellout" src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-e23b028d-83f4-42d2-867b-f7a1a1f7fe8f.png" />
          {% endif %}
        </div>
        <div class="text">
          <h4 class="name text-ellipsis">{{ item.goodsName }}</h4>
          <small class="brief">
          积分：<i class="split text-orange">{{ item.consumeIntegral }}</i>
          {% if item.marketPrice %}
            <i class="text-gray">{{ item.marketPrice|currency(0) }}</i></small>
          {% endif %}
        </div>
      </a>
    {% endfor %}
  </script>
{% endraw %}
{% endblock %}
{% block script %}
{% parent %}
<script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}